package exodus;

/**
 * Created with IntelliJ IDEA.
 * User: JSmith1
 * Date: 7/27/12
 * Time: 11:59 AM
 * An object that represents an instance of foodstuffs in Exodus.
 */
public class Food implements Comparable<Food>{
    //fields
    private String itemid; //A unique identifier for this instance of food from the database.
    private String name; //the descriptor designating the piece of food
    private double weight;
    private int daysToSpoil;
    private int rads;

    //constructors
    public Food(){}

    public Food(String itemid, String name, double weight, int daysToSpoil, int rads){
        this.itemid = itemid;
        this.name = name;
        this.weight = weight;
        this.daysToSpoil = daysToSpoil;
        this.rads = rads;
    }

    //getters and setters
    public String getItemid() {
        return itemid;
    }

    public void setItemid(String itemid) {
        this.itemid = itemid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public int getDaysToSpoil() {
        return daysToSpoil;
    }

    public void setDaysToSpoil(int daysToSpoil) {
        this.daysToSpoil = daysToSpoil;
    }

    public int getRads() {
        return rads;
    }

    public void setRads(int rads) {
        this.rads = rads;
    }

    @Override
    public int compareTo(Food o) {
        return this.itemid.compareTo(o.itemid);
    }

    public boolean equals(Food o){
        return this.itemid.equals(o.getItemid());
    }
}
